<template>
  <span ref="a">
    {{ counter }}
    <button @click="onAdd">+1</button>
  </span>
</template>

<script>
export default {
  data() {
    return {
      counter: 1,
    };
  },
  created() {
    Promise.resolve(999).then((res) => {
      this.counter = res;

      this.$nextTick(() => {
        console.log(this.$refs.a.offsetWidth);
        onsole.log(this.$refs.a.offsetWidth);

      });
    });
  },
  methods: {
    onAdd() {
      this.counter++;
    },
  },
};
</script>

<style>
</style>
